WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::TrackMatrix Class Reference

Matrix of tracked features, by track and by snapshot (Captures or time stamps) This class implements the following data structure: More...

#include <core/processor/track_matrix.h>

Public Member Functions

 TrackMatrix ()
 
virtual ~TrackMatrix ()
 
void newTrack (FeatureBasePtr _ftr)
 
void add (const SizeStd &_track_id, const FeatureBasePtr &_ftr)
 
void add (const FeatureBasePtr &_ftr_existing, const FeatureBasePtr &_ftr_new)
 
void remove (FeatureBasePtr _ftr)
 
void remove (const SizeStd &_track_id)
 
void remove (CaptureBasePtr _cap)
 
SizeStd numTracks () const
 
SizeStd trackSize (const SizeStd &_track_id) const
 
TrackConst track (const SizeStd &_track_id) const
 
Track track (const SizeStd &_track_id)
 
SnapshotConst snapshot (CaptureBaseConstPtr _capture) const
 
Snapshot snapshot (CaptureBasePtr _capture)
 
vector< FeatureBaseConstPtr > trackAsVector (const SizeStd &_track_id) const
 
vector< FeatureBasePtr > trackAsVector (const SizeStd &_track_id)
 
FeatureBaseConstPtrList snapshotAsList (CaptureBaseConstPtr _cap) const
 
FeatureBasePtrList snapshotAsList (CaptureBasePtr _cap)
 
TrackMatchesConst matches (CaptureBaseConstPtr _cap_1, CaptureBaseConstPtr _cap_2) const
 
TrackMatches matches (CaptureBasePtr _cap_1, CaptureBasePtr _cap_2)
 
FeatureBaseConstPtr firstFeature (const SizeStd &_track_id) const
 
FeatureBasePtr firstFeature (const SizeStd &_track_id)
 
FeatureBaseConstPtr lastFeature (const SizeStd &_track_id) const
 
FeatureBasePtr lastFeature (const SizeStd &_track_id)
 
FeatureBaseConstPtr feature (const SizeStd &_track_id, CaptureBaseConstPtr _cap) const
 
FeatureBasePtr feature (const SizeStd &_track_id, CaptureBasePtr _cap)
 
CaptureBaseConstPtr firstCapture (const SizeStd &_track_id) const
 
CaptureBasePtr firstCapture (const SizeStd &_track_id)
 
CaptureBaseConstPtr lastCapture (const SizeStd &_track_id) const
 
CaptureBasePtr lastCapture (const SizeStd &_track_id)
 
list< SizeStd > trackIds (CaptureBaseConstPtr _capture=nullptr) const
 
TrackConst trackAtKeyframes (const SizeStd &_track_id) const
 
Track trackAtKeyframes (const SizeStd &_track_id)
 
void cleanSnapshots ()
 

Detailed Description

Matrix of tracked features, by track and by snapshot (Captures or time stamps) This class implements the following data structure:

Snapshots at each capture Cx: C1 C2 C3 C4 C5 Tracks for each matched feature: f1 — f3 — f7 — f11 – f14 <– track 1, of corresponding features in different captures | | | | | | f4 — f8 — f12 – f15 <– track 2 | | | | | f5 — f9 — f13 <– track 3 | | | f2 — f6 — f10 <– track 4

Each 'f' is a feature pointer of the type FeatureBasePtr

This structure allows accessing all the history of matched features with two different accesses:

 Track:    track-wise:   a track of features matches along a timely sequence of Captures, indexed by time stamp.

                         map<TimeStamp ts, FeatureBasePtr f>

 Snapshot: capture-wise: a set of features tracked in a single Capture, indexed by track id:

                         map<SizeStd track_id, FeatureBasePtr f>

The class makes sure that both accesses are consistent each time some addition or removal of features is performed.

The storage is implemented as two maps of maps, so each addition and removal of single features is accomplished in logarithmic time:

 Tracks are identified with the track ID in           f->trackId()
 Snapshots are identified with the Capture pointer in f->getCapture()

these fields of FeatureBase are initialized each time a feature is added to the track matrix:

 add(Cap, track_id, f) will set f.capture_ptr = C and f.track_id = track_id.

so e.g. given a feature f,

 getTrack   (f->trackId()) ;       // returns all the track where feature f is.
 getSnapshot(f->getCapture()) ;    // returns all the features in the same capture of f.

Constructor & Destructor Documentation

◆ TrackMatrix()

wolf::TrackMatrix::TrackMatrix ( )

◆ ~TrackMatrix()

wolf::TrackMatrix::~TrackMatrix ( )
virtual

Member Function Documentation

◆ add() [1/2]

void wolf::TrackMatrix::add ( const FeatureBasePtr &  _ftr_existing,
const FeatureBasePtr &  _ftr_new 
)

◆ add() [2/2]

void wolf::TrackMatrix::add ( const SizeStd &  _track_id,
const FeatureBasePtr &  _ftr 
)

◆ cleanSnapshots()

void wolf::TrackMatrix::cleanSnapshots ( )

◆ feature() [1/2]

FeatureBaseConstPtr wolf::TrackMatrix::feature ( const SizeStd &  _track_id,
CaptureBaseConstPtr  _cap 
) const

◆ feature() [2/2]

FeatureBasePtr wolf::TrackMatrix::feature ( const SizeStd &  _track_id,
CaptureBasePtr  _cap 
)

◆ firstCapture() [1/2]

CaptureBasePtr wolf::TrackMatrix::firstCapture ( const SizeStd &  _track_id)

◆ firstCapture() [2/2]

CaptureBaseConstPtr wolf::TrackMatrix::firstCapture ( const SizeStd &  _track_id) const

◆ firstFeature() [1/2]

FeatureBasePtr wolf::TrackMatrix::firstFeature ( const SizeStd &  _track_id)

◆ firstFeature() [2/2]

FeatureBaseConstPtr wolf::TrackMatrix::firstFeature ( const SizeStd &  _track_id) const

◆ lastCapture() [1/2]

CaptureBasePtr wolf::TrackMatrix::lastCapture ( const SizeStd &  _track_id)

◆ lastCapture() [2/2]

CaptureBaseConstPtr wolf::TrackMatrix::lastCapture ( const SizeStd &  _track_id) const

◆ lastFeature() [1/2]

FeatureBasePtr wolf::TrackMatrix::lastFeature ( const SizeStd &  _track_id)

◆ lastFeature() [2/2]

FeatureBaseConstPtr wolf::TrackMatrix::lastFeature ( const SizeStd &  _track_id) const

◆ matches() [1/2]

TrackMatchesConst wolf::TrackMatrix::matches ( CaptureBaseConstPtr  _cap_1,
CaptureBaseConstPtr  _cap_2 
) const

◆ matches() [2/2]

TrackMatches wolf::TrackMatrix::matches ( CaptureBasePtr  _cap_1,
CaptureBasePtr  _cap_2 
)

◆ newTrack()

void wolf::TrackMatrix::newTrack ( FeatureBasePtr  _ftr)

◆ numTracks()

SizeStd wolf::TrackMatrix::numTracks ( ) const

◆ remove() [1/3]

void wolf::TrackMatrix::remove ( CaptureBasePtr  _cap)

◆ remove() [2/3]

void wolf::TrackMatrix::remove ( const SizeStd &  _track_id)

◆ remove() [3/3]

void wolf::TrackMatrix::remove ( FeatureBasePtr  _ftr)

◆ snapshot() [1/2]

SnapshotConst wolf::TrackMatrix::snapshot ( CaptureBaseConstPtr  _capture) const

◆ snapshot() [2/2]

Snapshot wolf::TrackMatrix::snapshot ( CaptureBasePtr  _capture)

◆ snapshotAsList() [1/2]

FeatureBaseConstPtrList wolf::TrackMatrix::snapshotAsList ( CaptureBaseConstPtr  _cap) const

◆ snapshotAsList() [2/2]

FeatureBasePtrList wolf::TrackMatrix::snapshotAsList ( CaptureBasePtr  _cap)

◆ track() [1/2]

Track wolf::TrackMatrix::track ( const SizeStd &  _track_id)

◆ track() [2/2]

TrackConst wolf::TrackMatrix::track ( const SizeStd &  _track_id) const

◆ trackAsVector() [1/2]

vector< FeatureBasePtr > wolf::TrackMatrix::trackAsVector ( const SizeStd &  _track_id)

◆ trackAsVector() [2/2]

vector< FeatureBaseConstPtr > wolf::TrackMatrix::trackAsVector ( const SizeStd &  _track_id) const

◆ trackAtKeyframes() [1/2]

Track wolf::TrackMatrix::trackAtKeyframes ( const SizeStd &  _track_id)

◆ trackAtKeyframes() [2/2]

TrackConst wolf::TrackMatrix::trackAtKeyframes ( const SizeStd &  _track_id) const

◆ trackIds()

list< SizeStd > wolf::TrackMatrix::trackIds ( CaptureBaseConstPtr  _capture = nullptr) const

◆ trackSize()

SizeStd wolf::TrackMatrix::trackSize ( const SizeStd &  _track_id) const

The documentation for this class was generated from the following files: